<?php

namespace app\common\model;

use think\Cache;
use think\Model;
use traits\model\SoftDelete;

/**
 * 课程关联题库分类
 */
class CourseQuestionCategory extends Model
{
    protected $table = 'fa_yalimedia_course_question_category';
    
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updateTime';

    use SoftDelete;
    protected $deleteTime = 'deletetime';

    public function course_question()
    {
        return $this->belongsTo('CourseQuestion','content_id');
    }
    

    public function getCreatetimeAttr($value)
    {   
        if(!empty($value)){
            return date('Y-m-d H:i:s',$value);
        }
        return '';
    }

    


}
